package com.avecsys.quotemanager.dao.supplier;

import java.util.List;

import com.avecsys.quotemanager.dao.common.BaseDAO;
import com.avecsys.quotemanager.exception.DAOException;
import com.avecsys.quotemanager.pojos.BuyerMasterPojo;
import com.avecsys.quotemanager.pojos.QuoteTransactionEventsPojo;
import com.avecsys.quotemanager.pojos.QuoteTransactionPojo;
import com.avecsys.quotemanager.pojos.SupplierMasterPojo;
import com.avecsys.quotemanager.utils.TransactionStatus;
import com.avecsys.quotemanager.vo.QuoteVO;

/**
 * @author Sam Sundar K
 */
public interface QuoteTransactionDAO extends BaseDAO
{

	/**
	 * Method to save the Quote Transaction and Quote Transaction Event
	 * 
	 * @param quoteTransactionsPojo
	 * @return TransactionStatus
	 * @throws DAOException
	 */
	TransactionStatus saveQuoteTransaction(QuoteTransactionPojo quoteTransactionsPojo)
			throws DAOException;

	/**
	 * Method to list all Sent Quotes of buyers belong to a supplier
	 * 
	 * @param supplierMasterPojo
	 * @return List<QuoteTransactionPojo>
	 * @throws DAOException
	 */
	List<QuoteTransactionPojo> findAllSentQuotes(SupplierMasterPojo supplierMasterPojo)
			throws DAOException;

	/**
	 * Method to list all Sent Quotes of buyers belong to a supplier
	 * 
	 * @param buyerMasterPojo
	 * @return List<QuoteTransactionEventsPojo>
	 * @throws DAOException
	 */
	List<QuoteTransactionEventsPojo> findAllQuoteEventsForBuyerAction(BuyerMasterPojo buyerMasterPojo)
			throws DAOException;

	/**
	 * Method to get any SubClass of BasePojo instance by Pk
	 * 
	 * @param BasePojo
	 * @param Pk
	 * @return BasePojo
	 * @throws DAOException
	 */
	public QuoteTransactionEventsPojo findQuoteTransactionEventsById(Long Pk) throws DAOException;

	/**
	 * Method to update the Buyers Action (Accept,Amend or Ignore)on Reply Quote.
	 * 
	 * @param quoteTransactionEventsPojo
	 * @return TransactionStatus
	 * @throws DAOException
	 */
	TransactionStatus updateBuyerReply(QuoteTransactionEventsPojo quoteTransactionEventsPojo)
			throws DAOException;

	/**
	 * Method to List all QuoteEvents for a Quote Transaction
	 * 
	 * @param quoteTransactionPojo
	 * @return List<QuoteTransactionEventsPojo>
	 * @throws DAOException
	 */
	List<QuoteTransactionEventsPojo> findAllQuoteEvents(QuoteTransactionPojo quoteTransactionPojo)
			throws DAOException;

	/**
	 * Method to create a new Quote Transaction event and update the master with child transaction status
	 * 
	 * @param quoteVO
	 * @return TransactionStatus
	 * @throws DAOException
	 */
	TransactionStatus createQuoteEvent(QuoteVO quoteVO) throws DAOException;

	/**
	 * Method to fetch all QuoteTransactionPojos the belong to a buyer by transaction status
	 * 
	 * @param buyerMasterPojo
	 * @param List<String> transactionStatusList
	 * @return List<QuoteTransactionPojo>
	 */
	List<QuoteTransactionPojo> findAllQuoteTransactionPojos(BuyerMasterPojo buyerMasterPojo,
			List<String> transactionStatusList) throws DAOException;;

}
